<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background: url(./img/0.jpg) no-repeat fixed center;
        }

        .box {
            width: 410px;
            height: 80px;
            border: 3px solid #fff;
            margin: auto;
            display: flex;
            justify-content: space-between;
            background: #fff;
        }

        .box div img {
            width: 100px;
            height: 80px;
        }
    </style>
</head>

<body>
    <div class="box" id="box">
        <div><img src="./img/0.jpg" alt=""></div>
        <div><img src="./img/1.jpg" alt=""></div>
        <div><img src="./img/2.jpg" alt=""></div>
        <div><img src="./img/3.jpg" alt=""></div>
    </div>

    <script>
        var imgs = document.querySelectorAll('img');
        for (var i = 0; i < imgs.length; i++) {
            imgs[i].onclick = function () {
                document.body.style.backgroundImage = 'url(' + this.src + ')';
            }
        }
    </script>
</body>

</html>